package com.cgtong.android.mvp.model;

import com.cgtong.android.bean.ActivityBean;
import com.cgtong.android.bean.BannerBean;
import com.cgtong.android.http.ApiManager;
import com.cgtong.android.http.ConstantManager;
import com.cgtong.android.mvp.contract.WonderfulActivityContract;
import com.zhouyou.http.EasyHttp;
import com.zhouyou.http.callback.CallBackProxy;
import com.zhouyou.http.callback.SimpleCallBack;
import com.zhouyou.http.model.ApiResult;

import java.util.List;

/**
 * Created by Sky.Bing on 2017/10/24.
 */

public class WonderfulActivityModel implements WonderfulActivityContract.Model {

    @Override
    public void getActivityList(int maxId, SimpleCallBack callBack) {
        EasyHttp.post(ApiManager.URL_GET_ACTIVITIES)
                .params("maxId", String.valueOf(maxId))
                .params("pagesize", String.valueOf(ConstantManager.MAX_WONDERFUL_NEWS_COUNT))
                .execute(new CallBackProxy<ApiResult<List<ActivityBean>>, List<ActivityBean>>(callBack) {
                });
    }

    @Override
    public void getBannerList(SimpleCallBack callBack) {
        EasyHttp.post(ApiManager.URL_GET_BANNER_LIST)
                .params("columnId", String.valueOf(ConstantManager.BANNER_COLUMN_ACTIVITY))
                .execute(new CallBackProxy<ApiResult<List<BannerBean>>, List<BannerBean>>(callBack) {
                });
    }
}